home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-0142 / programs / colacalc.txt < prev    next >
Text File  |  1997-04-16  |  11KB  |  262 lines

  1.                             ColaCalc (Version 1.0)
  2.                                  by Dan Wilga
  3.  
  4.           Copyright © 1991, Gribnif Software.  All Rights Reserved.
  5.  
  6. This program may be distributed without charge, provided that this text file
  7. is present and that it and the program files are unmodified.
  8.  
  9.  
  10. Overview
  11. --------
  12.  
  13.   What? ANOTHER calculator? Yup, another calculator. But this one's different,
  14.   I promise!
  15.   
  16.   There are a number of really good calculator programs out there for the ST.
  17.   Most of them just don't fit my needs for several reasons. The simple ones
  18.   don't have what I need, and the ones that do have all of the programming
  19.   functions I want are too huge, difficult to use, and take too much memory.
  20.   And even though most of them are desk accessories, you still can't access
  21.   a desk accessory within a non-GEM program. So I've always had to keep my old
  22.   Casio calculator sitting on top of the computer.
  23.   
  24.   Enter ColaCalc. This tiny little program (about 8k) is a full-featured
  25.   programmer's calculator. No pretty dialog box, no floating point, no
  26.   linear regression, but a calculator that's always there when you need it.
  27.   And, best of all, you can change the keys to whatever you want, you aren't
  28.   stuck with what I think are good keyboard equivalents!
  29.   
  30.   ColaCalc can be activated at a single keypress. The display occupies the
  31.   very bottom of your screen, and as such hides very little data. The
  32.   calculator functions include the standard operators, bit manipulation,
  33.   word size and base (binary, octal, decimal, or hex.) There is also a
  34.   special mode that lets you see the scan code generated by any key on the
  35.   keyboard.
  36.   
  37.   It is also designed to work with any display, and works with the Mega STe
  38.   and TT computers.
  39.  
  40.  
  41. Installation:
  42. ------------
  43.  
  44.   Run COLACALC.PRG from the desktop, or place it in your AUTO folder. If you
  45.   use a COLACALC.DAT file, then it should be in the same folder as the program.
  46.   If you are holding down the Alternate key while ColaCalc is loading, then it
  47.   will not install itself. This is a good way to keep it from installing when
  48.   it is in your AUTO folder, without having to re-boot.
  49.  
  50.  
  51. Activating It:
  52. -------------
  53.  
  54.   Unless you have changed the activation keypress (see Configuration), you
  55.   can always call ColaCalc from within any program simply by pressing
  56.   Control-Undo. The only time ColaCalc may not appear is when a disk access
  57.   is occuring. To quit ColaCalc, press either Esc or Undo.
  58.   
  59.  
  60. The Display:
  61. -----------
  62.  
  63.   Here is a diagram of what the parts of the display mean:
  64.   
  65.                 ulb 10100010101010001010100010101001 XOR 1.......9.
  66.                 ||| \                              /  |  \         \
  67.                / | \  --------- number -----------    |   function key memories
  68. signed/unsigned  |  base                           operator
  69.              word size
  70.  
  71.  
  72.   All keyboard controls listed below are the defaults.
  73.  
  74.   Signed (S key); Unsigned (U key):
  75.   
  76.     These control whether or not a negative number is to be displayed with a
  77.     minus sign in front of it (signed) or if the sign bit should be displayed
  78.     as part of the number (unsigned). These can also affect translating
  79.     between word sizes (see below).
  80.     
  81.   Word Size: Byte (Alt-B); Word (Alt-W); Long (Alt-L):
  82.   
  83.     By setting the word size you affect how much of the number is displayed.
  84.     If, for example, the display is set for Byte, the largest value that can
  85.     be displayed is FF (hex).
  86.     
  87.     When changing from a small word size to a larger one, the value is
  88.     sign-extended if the display is set to show the sign, otherwise it is not.
  89.     This means that if, for example, you are converting FF from a byte to a
  90.     word without the sign, then this will become 00FF. If, on the other hand,
  91.     the sign is being used, FF (which shows up as -1) will still be -1 after
  92.     the extension.
  93.  
  94.   Base: Binary (Control-B); Octal (Control-O); Decimal (Control-D);
  95.       Hexadecimal (Control-H):
  96.       
  97.     These control the base to display values in. In Binary mode, large
  98.     numbers will have small circles after every eight bits to indicate
  99.     the byte boundaries.
  100.     
  101.   Number:
  102.   
  103.     The keys 0-9 and A-F (or a-f) can be used to enter numbers. The keypad
  104.     keys will also work under the default configuration.
  105.   
  106.   Function:
  107.   
  108.     This portion of the display shows what function was last entered. It may
  109.     also contain "-E-" if an error occurred; if this happens, press Clr/Home.
  110.     
  111.   Function Key Memories:
  112.   
  113.     The F1-F10 keys can be assigned values by pressing Shift along with the
  114.     appropriate F-key. A number can be recalled later by pressing just the
  115.     function key, without Shift. If a particular function key has a non-zero
  116.     value assigned to it, this will show up in the function key segment of the
  117.     display.
  118.  
  119.   The display will not include the function key segment or the function name if
  120.   you are using low resolution.
  121.  
  122.  
  123. Miscellaneous Keys:
  124. ------------------
  125.  
  126.   =, Return, Enter      Calculate result
  127.   Undo, Esc             Quit ColaCalc
  128.   Clr/Home              Clear display/Clear error
  129.   Shift-Fkey            Set memory
  130.   Fkey                  Recall memory
  131.   Backspace             Undo last digit typed
  132.   Help                  Enter/Exit Keypress mode
  133.  
  134.   The first time you press Clr/Home clears the display or any error condition,
  135.   which shows up as "-E-". If you press it a second time, any operator still
  136.   waiting to be processed is cleared.
  137.  
  138.   When in Keypress mode, the display shows the value for any shift keys
  139.   pressed, the scan code of the last key pressed, its ASCII value in hex,
  140.   and the actual character that key produces (if non-zero.) This is handy
  141.   for writing your own configuration file (see below). To exit Keypress mode,
  142.   press the Help key again.
  143.  
  144.  
  145. Operators:
  146. ---------
  147.  
  148.   Unary operators (NEG, NOT and the PEEKs) are processed immediately. Binary
  149.   operators (like + and *) are processed in the order they are received, with
  150.   the exception of * and /, which take highest precedence. This means that:
  151.  
  152.     1 + 2 * 3      is processed as  1+(2*3)
  153.     1 * 2 + 3      is processed as  (1*2)+3
  154.     1 + 2 * 3 / 2  is processed as  1+((2*3)/2)
  155.     1 & 2 * 3      is processed as  1&(2*3)
  156.  
  157.   If the second operand is not entered for a binary operator, then the
  158.   first operand is reused. This means that:
  159.   
  160.     2 * =          is processed as  2*2
  161.     4 / =          is processed as  4/4
  162.  
  163.   A binary operator can be replaced with another by simply entering the
  164.   new operator before typing anything else. Thus:
  165.   
  166.     1 + * 4        is processed as  1*4
  167.     3 / - 2        is processed as  3-2
  168.  
  169.  Key          Operation                         Type (Unary or Binary)
  170.  ---          ---------                         ---------------------
  171.   +             Add                                       B
  172.   -             Subtract                                  B
  173.   *             Multiply                                  B
  174.   /             Divide                                    B
  175.   %             Modulo (result after division)            B
  176.   !             NOT (one's complement)                    U
  177.   Delete        NEG (two's complement)                    U
  178.   &             AND                                       B
  179.   |             OR                                        B
  180.   ^             XOR (exclusive or)                        B
  181.   left arrow    ROL (rotate left)                         B
  182.   Control-left  LSL (shift left)                          B
  183.   right arrow   ROR (rotate right)                        B
  184.   Control-right LSR/ASR (shift right)                     B
  185.   Control-P     PEEK LONG                                 U
  186.   Left Shift-P  PEEK WORD                                 U
  187.   Alt-P         PEEK BYTE                                 U
  188.  
  189.  
  190.   Both ROR and ROL always begin with a carry of zero. They act just like their
  191.   equivalent 68xxx instructions. The value to be manipulated is entered first,
  192.   followed by the operator, and then the number of bits to rotate.
  193.  
  194.   The Control-right arrow will use a logical shift if the display does not
  195.   show the sign. In Signed mode, an arithmetic shift is performed.
  196.  
  197.   The three types of PEEK work by treating the value in the display as a
  198.   pointer into the computer's memory. The value at that memory location is
  199.   then moved into the display. For PEEK WORD and PEEK BYTE, the value is
  200.   sign-extended if the Sign mode is set. Attempting to PEEK LONG or PEEK WORD
  201.   at an odd address will generate an error.
  202.  
  203.  
  204. Configuration:
  205. -------------
  206.  
  207.   When it first runs, ColaCalc looks for a file called COLACALC.DAT in the
  208.   same folder where COLACALC.PRG is, which contains configuration information.
  209.   This file can be modified with a text editor. Each line contains one keyboard
  210.   equivalent or function key assignment. The first part of a line must always
  211.   contain data to be read by ColaCalc; the remainder of the line is ignored
  212.   and can be used for comments. Blank lines are ignored.
  213.   
  214.   The basic layout of the file is as follows:
  215.   
  216.     Default display state
  217.     Key to activate
  218.     26 Operators and display controls
  219.     10 Function key defaults
  220.  
  221.   The first line must contain three characters for the default display, and
  222.   they must all be lowercase. All other values must either be in hex or must
  223.   be a single raw ASCII character. The various values can be separated by
  224.   spaces or tabs.
  225.   
  226.   There are two ways that keypresses can be defined: either by ASCII value or
  227.   by scan code. To define a keypress by ASCII, enter an asterisk in the first
  228.   column and the ASCII character (either the character itself or its hex value)
  229.   in the second column. To enter a keypress by its scan code, the first column
  230.   contains the shift key status, from the table below, and the second contains
  231.   the scan code:
  232.   
  233.     Key Pressed:     Value:
  234.     Right Shift        1
  235.     Left Shift         2
  236.     Control            4
  237.     Alternate          8
  238.     
  239.   For example, to specify the "p" key, you would use "* p". To specify
  240.   Control-Alternate-p, you would use "C 19" (8+4=C, and $19 is the scan code.)
  241.   The Keypress mode in ColaCalc (activated with the Help key) is helpful for
  242.   determining what values to use.
  243.  
  244.  
  245. About "Colaware":
  246. ----------------
  247.  
  248.   You've heard of public domain, you've heard of shareware. This program,
  249.   however, is Colaware:  if you like it, you are encouraged (though not
  250.   necessarily required) to send copious quantities of highly caffeinated
  251.   beverages (Coke, Pepsi, Jolt, etc.) to the address below (via U.S. Mail,
  252.   please; UPS won't deliver to a P.O. Box) so that I can continue to create
  253.   more products like this one.  Coupons are accepted.
  254.  
  255.     Gribnif Software
  256.     P.O. Box 350
  257.     Hadley, MA  01035
  258.     
  259.   Internet:  Dan.Wilga@saturn.ucc.umass.edu
  260.   GEnie:     GRIBNIF
  261.  
  262.